<?PHP

class OP_TagCloudWidget extends OP_WidgetTemplate{
	function render(){
		$title = empty( $this->values['title'] ) ? __( 'Tags' ) : apply_filters('widget_title', $this->values['title']);
		$c = $this->values['count'] ? '1' : '0';
		$d = $this->values['dropdown'] ? '1' : '0';

		echo $this->values['before_title'] . $title . $this->values['after_title'];
		wp_tag_cloud();
	}
	
	function do_post($post){
		$title = strip_tags(stripslashes($post["title"]));
		return compact( 'title' );		
	}

	function options(){
		$title = attribute_escape($this->values['title']);
		
		echo '<p><label for="'.$this->widget->class.'-title-'.$this->values['number'].'">'._e('Title:').' <input class="widefat" id="'.$this->widget->class.'-title-'.$this->values['number'].'" name="'.$this->widget->class.'['.$this->values['number'].'][title]" type="text" value="'.$title.'" /></label></p>';
	}	

	
}
		
$widget = new OP_Widget('op_tag_cloud');
$widget->setMeta('OP Tag Cloud',"Your most used tags in cloud format");
$widget->setDefaults(array('title'=>''));

$opw_tag_cloud = new OP_TagCloudWidget($widget);
add_action('widgets_init', array($opw_tag_cloud, 'init'));

?>